//
//  YFFileManager.h
//  YFFileMangerDemo
//
//  Created by yefei on 2019/4/24.
//  Copyright © 2019 yefei. All rights reserved.
//

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN

@interface YFFileManager : NSObject

#pragma mark -
#pragma mark - 常用路径属性

@property (class, nonatomic, strong, readonly) YFFileManager *shared;
/**
 doucments 路径
 */
@property (class, nonatomic, copy, readonly) NSString *doucments;
/**
 library 路径
 */
@property (class, nonatomic, copy, readonly) NSString *library;
/**
 caches 路径
 */
@property (class, nonatomic, copy, readonly) NSString *caches;
/**
 home 路径
 */
@property (class, nonatomic, copy, readonly) NSString *home;
/**
 temporary 路径
 */
@property (class, nonatomic, copy, readonly) NSString *temporary;

/**
 Library 下的 Application Support 文件夹路径
 */
@property (class, nonatomic, copy, readonly) NSString *applicationSupport;

#pragma mark -
#pragma mark - 绝对单例
/**
 绝对单例

 @return 单例
 */
+ (instancetype)shared;

#pragma mark -
#pragma mark - 常用方法
/**
 判断文件/文件夹是否存在
 // 需传全路径
 */
+(BOOL(^)(NSString *fullPath))exist;

/**
 创建文件夹（目录）需要传全路径
 */
+ (NSString * _Nullable(^)(NSString *fullPath))createDirectory;

/**
 在Documents中创建文件目录
 */
+ (NSString * _Nullable(^)(NSString *path))createDirectoryInDocuments;

/**
 在Library中创建文件目录
 */
+(NSString * _Nullable(^)(NSString *path))createDirectoryInLibrary;

/**
 在Caches创建文件目录
 */
+(NSString * _Nullable(^)(NSString *path))createDirectoryInCaches;

/**
 在Temporary创建文件目录
 */
+(NSString * _Nullable(^)(NSString *path))createDirectoryInTemporary;

/**
 在 ApplicationSupport 创建路径
 */
+ (NSString * _Nullable(^)(NSString *path))createDirectoryInApplicationSupport;

/**
 创建文件
 全路径
 指定文件名称
 */
+ (NSString *_Nullable(^)(NSString *fullPath, NSString *fileName))createFile;

/**
 在Documents下创建文件
 传文件名称
 */
+ (NSString *_Nullable(^)(NSString *fileName))createFileInDocuments;

/**
 删除指定路径中的文件
 需传全路径
 */
+(BOOL(^)(NSString *fullPath, NSString *fileName))deleteFile;

/**
 移动文件
 */
+ (void(^)(NSString *fileName, NSString *fromPath, NSString *toPath))moveFile;


@end

NS_ASSUME_NONNULL_END
